Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

namespace: support set namespace for meta #834

Merged
merged 2 commits into from
Nov 8, 2017

Conversation

disksing
Copy link
Contributor

@disksing disksing commented Nov 6, 2017

Fix #824

c.Assert(tableClassifier.AddMetaToNamespace("test1"), IsNil)
// Can't be set again.
c.Assert(tableClassifier.AddMetaToNamespace("test1"), NotNil)
c.Assert(tableClassifier.AddMetaToNamespace("test2"), NotNil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we just allow one namespace to add meta?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same behavior as tables, a table or meta is only allow to bind to a namespace.

Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

return namespace.DefaultNamespace
}

for name, ns := range c.nsInfo.namespaces {
_, ok := ns.TableIDs[tableID]
if ok {
if ok || (isMeta && ns.Meta) {
return name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any test to cover meta here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@siddontang siddontang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@siddontang siddontang merged commit a685b9b into tikv:master Nov 8, 2017
@disksing disksing deleted the meta-namespace branch November 8, 2017 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants